package com.ycfmedical.bed.present;

import com.ycfmedical.bed.local.DataManager;
import com.ycfmedical.bed.local.dao.PhysicianChargeDAO;
import com.ycfmedical.bed.local.entity.PhysicianChargeMsg;
import com.ycfmedical.bed.ui.fragment.PhysicianChargeFragment;

import java.util.ArrayList;
import java.util.List;

import cn.droidlover.xdroidmvp.kit.Kits;
import cn.droidlover.xdroidmvp.log.XLog;
import cn.droidlover.xdroidmvp.mvp.XPresent;

/**
 * Created by Administrator on 2017-03-27.
 */

public class PhysicianChargePresenter extends XPresent<PhysicianChargeFragment> {
    public void loadData(long id) {

        List<PhysicianChargeMsg> physicianChargeMsgListAll = PhysicianChargeDAO.getAllStaffInfoList();
        List<PhysicianChargeMsg> usersPhysicianMsgLists = new ArrayList<>();
        XLog.i("physicianpid:",physicianChargeMsgListAll.get(0).toString());
        XLog.i("physicianp:",physicianChargeMsgListAll.get(0).getUserId());
        if (!Kits.Empty.check(physicianChargeMsgListAll)) {
            for (PhysicianChargeMsg physicianMsg : physicianChargeMsgListAll) {
                if (physicianMsg.getUserId() == id) {
                    usersPhysicianMsgLists.add(physicianMsg);
                }
            }
        }
        getV().showData(usersPhysicianMsgLists);
    }
}
